package com.lh.fruit.service.impl;

import com.lh.fruit.dao.FruitDAO;
import com.lh.fruit.dao.impl.FruitDAOImpl;
import com.lh.fruit.pojo.Fruit;
import com.lh.fruit.service.FruitService;

import java.util.List;

public class FruitServiceIpml implements FruitService {
    private FruitDAO fruitDAO= new FruitDAOImpl();
    @Override
    public List<Fruit> getFruitList() {
        return fruitDAO.getFruitList();
    }

    @Override
    public Fruit getFruitByFid(Integer fid) {
        return fruitDAO.getFruitByFid(fid);
    }

    @Override
    public void updateByFid(Fruit fruit) {
        fruitDAO.updateByFid(fruit);
    }

    @Override
    public void delByFid(Integer fid) {
fruitDAO.delByFid(fid);
    }

    @Override
    public void add(Fruit fruit) {
fruitDAO.add(fruit);
    }

    @Override
    public List<Fruit> getFruitByQuery(String keyword, Integer pageNo, String pageSize) {
        return fruitDAO.getFruitByQuery(keyword, pageNo, pageSize);
    }

    @Override
    public Integer getCountByQuery(String keyword) {
        return fruitDAO.getCountByQuery(keyword);
    }
}
